package com.ruoyi.fangyuan.config;

import org.jasypt.encryption.StringEncryptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @Title: EncryptorBean
 * @Description:
 * @Auther: 龙天
 * @Version: 1.0
 * @create 2023/5/5 19:57
 */
@Component
public class EncryptorBean {
    private final StringEncryptor encryptor;

    @Autowired
    public EncryptorBean(StringEncryptor encryptor) {
        this.encryptor = encryptor;
    }

    public String encrypt(String value) {
        return encryptor.encrypt(value);
    }
}
